﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iTeachSoft.Presentation.Code.Utility;
using System.Drawing;

namespace iTeachSoft.Presentation.Code.Managers
{
    public class EventsManagement
    {
        private static EventsManagement mInstance = null;

        //Singleton class to handle events
        public static EventsManagement Instance
        {
            get
            {
                if (mInstance == null) mInstance = new EventsManagement();
                return mInstance;
            }
        }

        public event EventHandler RefreshMainToolbarInvoked;
        public void OnRefreshToolbarInvoked(object sender, EventArgs e)
        {
            if (RefreshMainToolbarInvoked != null)
                RefreshMainToolbarInvoked(sender, e);
        }

        public event EventHandler ReflectProjectInvoked;
        public void OnReflectProjectInvoked(object sender, EventArgs e)
        {
            if (ReflectProjectInvoked != null)
                ReflectProjectInvoked(sender, e);
        }

        public event EventHandler<SingleItemEventArgs<int>> SelectedSlideIndexChanged;
        public void OnSelectedSlideIndexChanged(object sender, SingleItemEventArgs<int> e)
        {
            if (SelectedSlideIndexChanged != null)
                SelectedSlideIndexChanged(sender, e);
        }

        public event EventHandler ReflectTreeViewRequested;
        public void OnReflectTreeViewRequested(object sender, EventArgs e)
        {
            if (ReflectTreeViewRequested != null)
                ReflectTreeViewRequested(sender, e);
        }

        public event EventHandler ReflectSlideViewerRequested;
        public void OnReflectSlideViewerRequested(object sender, EventArgs e)
        {
            if (ReflectSlideViewerRequested != null)
                ReflectSlideViewerRequested(sender, e);
        }

        public event EventHandler<SingleItemEventArgs<Bitmap[]>> RecordingEnded;
        public void OnRecordingEnded(object sender, SingleItemEventArgs<Bitmap[]> e)
        {
            if (RecordingEnded != null)
                RecordingEnded(sender, e);
        }

        //TODO add more events if necessary
    }
}
